﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ChineseSchool.BLL;
using ChineseSchool.Models.Hethong;

namespace ChineseSchool.UserControl.ThuNghiem
{
    public partial class Album : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            //lblAlbums.Text = LoadAlbums();
        }

        public string LoadAlbums()
        {
            var str = "";
            var lstTopAlbum = new B_Album().GetTop6Album();
            if (lstTopAlbum != null && lstTopAlbum.Count > 0)
            {
                str += "<section class=\"featured-world-news\">";
                str += "    <ul>";
                foreach (M_Album album in lstTopAlbum)
                {
                    str += "<li>";
                    str += "    <div class=\"ccr-thumbnail\">";
                    str += "       <img src=\"" + album.ImageUrl + "\" alt=\"" + album.AlbumName + "\">";
                    str += "        <p><a href=\"#\">Chi tiết</a></p>";
                    str += "    </div>";
                    str += "    <h5><a href=\"#\">" + album.AlbumName + "</a></h5>";
                    str += "</li>";
                }
                str += "    </ul>";
                str += "</section>";

            }
            return str;
        }
    }
}